#!/usr/bin/env python
"""
plot_overlap_original.py

"""

import matplotlib.pyplot as plt
import numpy as np

# load files as averages
dt0 = np.average(np.loadtxt('dt[0].out'), 0)

dtplus5  = np.average(np.loadtxt('dt[5.0].out'), 0)
dtminus5 = np.average(np.loadtxt('dt[-5.0].out'), 0)
dtplus10  = np.average(np.loadtxt('dt[10.0].out'), 0)
dtminus10 = np.average(np.loadtxt('dt[-10.0].out'), 0)
dtplus25  = np.average(np.loadtxt('dt[25.0].out'), 0)
dtminus25 = np.average(np.loadtxt('dt[-25.0].out'), 0)
dtminus50 = np.average(np.loadtxt('dt[-50.0].out'), 0)
dtplus50 = np.average(np.loadtxt('dt[50.0].out'), 0)
dtplus100  = np.average(np.loadtxt('dt[100.0].out'), 0)
dtminus100  = np.average(np.loadtxt('dt[-100.0].out'), 0)

# plot averages
plt.plot( dt0, 'o-')
plt.plot( dtplus10, 'o-')
plt.plot( dtminus10, 'o-')
plt.plot( dtplus25, 'o-')
plt.plot( dtminus25, 'o-')
plt.plot( (np.isnan(dtplus50)).choose(dtplus50, 0), 'o-')
plt.plot( (np.isnan(dtminus50)).choose(dtminus50,0), 'o-')
plt.plot( (np.isnan(dtplus100)).choose(dtplus100, 0), 'o-')
plt.plot( (np.isnan(dtminus100)).choose(dtminus100,0), 'o-')

plt.ylim(ymin=0, ymax=1.2)
plt.xlim(xmin=-0.2, xmax=9.2)
plt.title('Original pattern')
plt.ylabel('Overlap with memory')
plt.xlabel('Recall step')
plt.show()
    
